class Solution:
    def isUgly(self, num: int) -> bool:
        if num <= 0:
            return False
        i, j ,k = 0, 0, 0
        while num % 2 == 0:
            num /= 2
            i += 1
        while num % 3 == 0:
            num /= 3
            j += 1
        while num % 5 == 0:
            num /= 5
            k += 1
        print(i, j ,k)
        return num == 1


a = Solution()
# print(a.isUgly(1))
# print(a.isUgly(8))
# print(a.isUgly(14))
# print(a.isUgly(15))
print(a.isUgly(2123366400))
